
import smsApi from '@/api/declaration/smsApi'
import httpRequest from '@/config/axios/httpRequest'
import {
  CreateSmsChannelReq,
  CreateSmsChannelResp,
  DeleteSmsChannelReq,
  DeleteSmsChannelResp,
  QuerySmsChannelDetailReq,
  QuerySmsChannelDetailResp,
  QuerySmsChannelPageReq,
  QuerySmsChannelPageResp,
  UpdateSmsChannelReq,
  UpdateSmsChannelResp
} from '@/models/system/SmsModel'

// 查询短信渠道列表
export const getSmsChannelPage = async (params: QuerySmsChannelPageReq) => {
  return await httpRequest.get<QuerySmsChannelPageResp>(smsApi.QuerySmsChannelPage, { params })
}

// 查询短信渠道详情
export const getSmsChannel = async (params: QuerySmsChannelDetailReq) => {
  return await httpRequest.get<QuerySmsChannelDetailResp>(smsApi.QuerySmsChannelDetail, { params })
}

// 新增短信渠道
export const createSmsChannel = async (data: CreateSmsChannelReq) => {
  return await httpRequest.post<CreateSmsChannelResp>(smsApi.CreateSmsChannel, data)
}

// 修改短信渠道
export const updateSmsChannel = async (data: UpdateSmsChannelReq) => {
  return await httpRequest.put<UpdateSmsChannelResp>(smsApi.UpdateSmsChannel, data)
}

// 删除短信渠道
export const deleteSmsChannel = async (params: DeleteSmsChannelReq) => {
  return await httpRequest.delete<DeleteSmsChannelResp>(smsApi.DeleteSmsChannel, { params })
}
